package cn.wanda.bi.sunshine.platform.server.config.redis;

import java.util.Collection;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.stereotype.Component;

@Component
public class MyShardedRedisCacheManager implements CacheManager, DisposableBean {
	
	@Autowired
	@Qualifier("myShardedRedisCache")
	private Cache cache;

	@Override
	public void destroy() throws Exception {
		cache.clear();
	}

	@Override
	public Cache getCache(String name) {
		return cache;
	}

	@Override
	public Collection<String> getCacheNames() {
		return null;
	}
	
}

